from django.contrib.auth.models import User
from django.db import models

class Link(models.Model):
    url = models.URLField(unique=True)
# Create your models here.

class Bookmark(models.Model):
    title = models.CharField(max_length=200)
    user = models.ForeignKey(User)
    link = models.ForeignKey(Link)
class Term:
    def __init__(self, term_id , term , synonym_group_id, term_type  ,term_description):
        self.term_id = term_id
        self.term = term
        self.synonym_group_id = synonym_group_id
        self.term_type = term_type
        self.term_description = term_description
class Pattern:
    def __init__(self,name,pattern):
        self.name = name
        self.pattern = pattern
class SearchResult:
    def __init__(self, title , date , content,summary,category):
        self.title = title
        self.date = date
        self.content = content
        self.summary = summary
        self.category = category
class Type:
    def __init__(self,id,name,des):
        self.id = id
        self.name = name
        self.des = des
class TermFreq:
    def __init__(self, timestamp, freq):
        self.timestamp = timestamp
        self.freq = freq
class Keyword:
    def __init__(self,keyword,freq):
        self.keyword = keyword
        self.freq = freq
